$(document).ready(function() {
	$(".chzn-select").chosen();
	var editUrl = __ctxPath+"/system/json_get_sys_role.do",
		delUrl = __ctxPath+"/system/json_del_sys_role.do",
		fieldArray = ['roleId','roleName','roleDesc','.chzn-select'],
		editArray = ['roleName','roleDesc','.chzn-select'];
	initPage('listPanel','detailPanel',editUrl,delUrl,fieldArray,editArray,afterLoadFn);
});  

function afterLoadFn(result){
	resources = result.resources;
	var chosen = $(".chzn-select");
	chosen.children("option:selected").attr("selected",false);
	for(var i=0;i<resources.length;i++){
		var r = resources[i];
		$("#roleRes option[value='"+r.resId+"']").attr("selected",true);
	}
	chosen.trigger("liszt:updated");
};